package com.vichat.common.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

/**
 * Created by wangly on 2018/7/17.
 */
@Component
public class ApplicationUtil implements ApplicationContextAware {
    private static transient Logger logger = LoggerFactory.getLogger(ApplicationUtil.class);

    private static ApplicationContext ctx;

    public ApplicationContext getApplicationContext(){

        return ctx;
    }
    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        this.ctx = applicationContext;
        I18NUtil.setApplicationContext(applicationContext);
    }
}
